#include "widget.h"
#include "ui_widget.h"
#include <QMessageBox>
#include <QString>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // 设置SpinBox的范围
    ui->spinBox_1->setRange(0, 10);
    ui->spinBox_2->setRange(0, 10);
    ui->spinBox_3->setRange(0, 10);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    // 获取下拉框中选中的内容
    QString text1 = ui->comboBox_1->currentText();
    QString text2 = ui->comboBox_2->currentText();
    QString text3 = ui->comboBox_3->currentText();

    QString output = text1 + ": " + QString::number(ui->spinBox_1->value()) +
                     "\n" + text2 + ": " + QString::number(ui->spinBox_2->value()) +
                     "\n" + text3 + ": " + QString::number(ui->spinBox_3->value());

    QMessageBox::information(this, "Output", output);
}

